import { Module } from '@nestjs/common';
import { TypeOrmModule } from '@nestjs/typeorm';
import { AppUser } from './user.entity';
import { AppUserController } from './user.controller';
import { AppUserService } from './user.service';
import { AppAuthService } from '../auth/auth.service';
import { PassportModule } from '@nestjs/passport';
import { JwtModule } from '@nestjs/jwt';
import configuration from 'src/config/configuration';
import { AppHistoryService } from '../history/history.service';
import { History } from '../history/history.entity';
import { SupabaseService } from 'src/modules/system/supabase/supabase.service';

@Module({
  imports: [
    PassportModule.register({ defaultStrategy: 'jwt' }),
    JwtModule.register({
      secret: configuration().jwt.secret,
      signOptions: {
        expiresIn: configuration().jwt.expiresIn,
      },
    }),
    TypeOrmModule.forFeature([AppUser, History]),
  ],
  controllers: [AppUserController],
  providers: [
    AppUserService,
    AppAuthService,
    AppHistoryService,
    SupabaseService,
  ],
  exports: [AppUserService],
})
export default class AppUserModule {}
